package cn.com.api.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.api.entity.ApiSmslog;
import cn.com.api.mapper.ApiSmslogMapper;
import cn.com.api.service.ApiSmslogService;

@Service
public class ApiSmslogServiceImpl implements ApiSmslogService {

	@Autowired
	private ApiSmslogMapper apiSmslogMapper;

	@Override
	public boolean checkPhone(String cTel) {
		boolean flag = false;
		ApiSmslog apiSmslog = apiSmslogMapper.checkPhone(cTel);
		if (apiSmslog != null) {
			flag = true;
		}
		return flag;
	}

	@Override
	public void saveSmslog(ApiSmslog apiSmslog) {
		apiSmslogMapper.saveSmslog(apiSmslog);
	}

	@Override
	public boolean checkCode(ApiSmslog apiSmslog) {
		boolean flag = false;
		ApiSmslog apiSmslog1 = apiSmslogMapper.checkCode(apiSmslog);
		if (apiSmslog1 != null) {
			flag = true;
		}
		return flag;
	}

	@Override
	public void updateSmslog(ApiSmslog apiSmslog) {
		apiSmslogMapper.updateSmslog(apiSmslog);
	}

	@Override
	public String getCodeBymob(String mob) {
		return apiSmslogMapper.getCodeBymob(mob);
	}

}
